<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>站点配置 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head.html"/>
<link href="${base}/thirdparty/swfupload2_5/swf.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">var _BASE="${base}/";</script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/swfupload.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/fileprogress.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/handlers_logo.js" charset="utf-8"></script>

<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	// 表单验证
	$inputForm.validate({
		rules: {
			name:"required"
		},
	});
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 站点配置&raquo; ${config.sitename!}
	</div>
	<form id="inputForm" action="o_config.jspx" method="post"  >
		<input type="hidden" name="configId" value="${config.id!}"/>
		<#if edit?? && edit><input type="hidden" name="edit" value="true"/></#if>
		<input type="hidden" name="oldPic" value="${config.sitelogo!}"/>
		
		<table class="input tabContent">
			<tr>
				<th><span class="requiredField">*</span>站点名称:</th>
				<td>
					<input type="text" name="name" class="text" maxlength="150"  value="${config.sitename!}" style="width:350px"/>
				</td>
			</tr>
			<tr>
				<th>站点LOGO：</th>
				<td class="logoimg">
					<a href="${base}${config.sitelogo!}"  target="_blank" title="查看"><img src="${base}${config.sitelogo!}" width="147" height="49" /></a>
				</td>
			</tr>
			<tr>
				<th>上传LOGO：</th>
				<td>
					<div id='fsUploadProgress'class='clearfix'>
					</div>
					<input type="button" id="uploadBtn" value="选择文件"  class="button"/>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.jspx'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
<script type='text/javascript'>
var swfu;
var jsessionid = getCookie("JSESSIONID");
var uploadUrl='/all_upload.jhtml';
if(jsessionid) {
	uploadUrl += ";jsessionid="+jsessionid;
}
var settings = {
	post_params: {"directory": "upload/logo"},
	flash_url:"${base}/thirdparty/swfupload2_5/swfupload.swf", 
	flash9_url:"${base}/thirdparty/swfupload2_5/swfupload_fp9.swf", 
	upload_url: uploadUrl,  
	file_size_limit:"1MB", 
	file_types:"*.jpg;*.png;*.gif;*.jpeg", 
	file_types_description:"JPG Images; PNG Image", 
	file_upload_limit:1, 
	file_queue_limit:0, 
	custom_settings:{progressTarget:"fsUploadProgress", cancelButtonId:"btnCancel"}, 
	button_image_url:"${base}/thirdparty/swfupload2_5/choose_file.jpg", 
	button_placeholder_id:"uploadBtn", 
	button_width:175, 
	button_height:52, 
	button_text_top_padding:0, 
	button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT, 
	button_cursor:SWFUpload.CURSOR.HAND, 
	swfupload_preload_handler:preLoad, 
	swfupload_load_failed_handler:loadFailed, 
	file_queued_handler:fileQueued, 
	file_queue_error_handler:fileQueueError, 
	upload_start_handler:uploadStart, 
	upload_progress_handler:uploadProgress, 
	upload_error_handler:uploadError, 
	upload_success_handler:uploadSuccess, 
	upload_complete_handler:uploadComplete
};

swfu = new SWFUpload(settings);
$(document).ready(function(){
	if( !swfu.support.loading ){
		$('#fsUploadProgress').html('您当前的Flash Player版本过低,无法支持头像上传,点击<a href="http://get.adobe.com/cn/flashplayer/otherversions/" target="_blank">下载</a>');
	}
})
</script>